What Is It?
===========

map2gl.py is a Python program that reads map data from the Final Fantasy
Tactics PSX CD and displays it on your computer using OpenGL.


System Requirements
===================

map2gl has been tested in Windows and Linux, and should also work in OS X.
You will need a video card with 16MB of onboard RAM, and Python with a few
of its libraries. See installation instructions.


Installation Instructions
=========================

1. Install Python 2.5.1 or greater.
2. Install setuptools 0.6c6 or greater.
3. Use setuptools (easy_install) to install the following:
    a. PIL (1.1.6 or greater)
    b. pyopengl (3.0.0a6 or greater)
    c. numpy (1.0.3.1 or greater)
4. Install wxPython (2.8.4.0 (or greater?))

Running map2gl
==============

To run map2gl, type the following at a command prompt:

    python map2gl.py <path_to_map_directory> [map_number]

map_number is a number between 1 and 125, inclusive, with some exceptions.
Look at the .GNS files in the CD's MAP directory to see what the valid
numbers are. If you omit map_number, the first map will load.

In Windows, this might look something like:

    C:\Documents and Settings\User\Desktop\map2gl\python map2gl.py D:\MAP 85

In Linux,

    [user@host map2gl]$ ./map2gl.py /cdrom/map 85

Note that in Linux (and OS X?), you have to mount the PSX CD without
Rock Ridge extensions:

    [user@host map2gl]$ sudo mount -o norock /dev/cdrom /cdrom


Camera Controls
===============

k: Decrease camera's altitude angle by 2 degrees
i: Increase camera's altitude angle by 2 degrees
K: Decrease camera's altitude angle to nearest snap
   (snap points at 0, 30, 45, 60, and 90 degress)
I: Increase camera's altitude angle to nearest snap
   (snap points at 0, 30, 45, 60, and 90 degress)
j: Stop camera's rotation, then decrease camera's azimuth angle by 2 degrees
l: Stop camera's rotation, then increase camera's azimuth angle by 2 degrees
J: Stop camera's rotation, then decrease camera's azimuth angle to nearest snap
   (snap points at multiples of 45 degrees)
L: Stop camera's rotation, then increase camera's azimuth angle to nearest snap
   (snap points at multiple of 45 degress)
,: Decrease the speed of the camera's rotation around the Y axis
.: Increase the speed of the camera's rotation around the Y axis
0: (zero): Stop camera rotation,
   then set camera's altitude angle to 0 and azimuth angle to 0.
-: Dolly the camera farther away from the map
=: Dolly the camera closer to the map
z: Set zoom level to 100% of in-game zoom level
o: Toggle between orthographic (isometric) and perspective projection
_: Decrease the camera's focal length (in perspective projection only)
+: Increase the camera's focal length (in perspective projection only)

You can also click the mouse and drag to rotate the map arbitrarily.


Other Controls
==============

[: Select previous map
]: Select next map
{: Select previous weather condition
}: Select next weather condition
s: Toggle whether the black polygons around the edges of the map
   (which I call "skirt" polygons) are displayed
x: Toggle display of axes (X=red, Y=green, Z=blue)
g: Toggle between the map's natural light and full ambient light
   (useful for Deep Dungeon maps)
b: Toggle "bright" mode
   (a hack that brightens the map by drawing it twice)
c: Toggle "cutaway" mode
   (avoids drawing certain obstructed or obstructing polygons)
t: Toggle terrain overlay mode
B: Toggle between the map's natural background and magenta background
a: Toggle mesh animation


Changelog
=========

20080401 - 0.17

 * Added preliminary support for placement grids.
 * Added support for Trap and Move/Find Item data.
 * Gave friendlier names to GNS items in info window.
 * Reorganized code a lot.
 * Added controls to camera window.
 * Improved texture transparency. No more flames in black boxes.

20080224 - 0.16

 * Added zoom function that approximates in-game zoom level.
 * Implemented extra meshes with animation. See map 103, for instance.
 * Improved resource-gathering algorithm, fixing map 53.

20080221 - 0.15

 * Switched from GLUT to wxPython to get a menu bar and extra windows.
 * Added support for switching weather conditions.

20080216 - 0.14

 * Changed texture fallback behavior. Uses monolithic texture if possible
   because it's faster, but otherwise falls back on separate textures,
   which look the same but are slower. Removed half-texture and
   limited-texture fallbacks.
 * Greatly improved terrain mode. Now displays slopes and depth
   and does so as an overlay instead of replacing normal polygons.
 * Improved cutaway mode. Most interiors should look right now.
 * Added magenta background mode for chroma keying.
 * Made default window size 800x600.

20080210 - 0.13

 * Improved camera controls and angle printing.
 * Added a half-size texture fallback mode between normal texture mode and
   limited texture mode.
 * Added basic ability to view terrain.
 * Added error trapping for divide-by-zero upon window resize.
 * Improved texture transparency detection.

20080208 - 0.12

 * Added this README document.
 * Added a limited-texture fallback mode between normal texture mode and
   textureless mode.
 * Added map names library and used it in lsgns.py and map2gl.py.
 * Implemented partial "cutaway" support.
 * Added feature to toggle between natural and full ambient light.
 * Stopped packaging glut32.dll with map2gl.


20080208 - 0.11

 * Added a textureless fallback mode if map2gl fails to load textures into
   video card.


20080207 - 0.10

 * Abandoned old vertex array code in favor of display lists.
 * Got rid of vertex sorting because it's slow and unnecessary.
 * Added toggles for "skirt" polygons and "bright" mode.
